package csci6450.chickenFriedFS.metaServer;

/**
 * This is a singleton class that will be used to store the settings the Meta
 * Server is initialized with. It will keep them in one place to make it easier
 * to access.
 * @author jacobschoen
 */
public class RuntimeSettings {

    private static RuntimeSettings settings = new RuntimeSettings();

    private RuntimeSettings(){
    }

    //-cp client listener port
    //-hb heart beat wait period
    //-ml meta server log location
    //-nslp nugget Server listener port


    /**
     * Gets the instance of this class.
     * @return
     */
    public static RuntimeSettings getInstance(){
        return settings;
    }

    /**
     * The port that the Meta Server will listen on for client requests.
     **/
    private int clientListenerPort = 3000;

    /**
     * Returns the port number the Meta Server listen on for client Requests.
     * @return the port number
     */
    public int getClientListenerPort(){
        return this.clientListenerPort;
    }

    /**
     * Sets the port number the Meta Server will listen on for client requests.
     * @param set the new port number
     */
    public void setClientListenerPort(int set){
        this.clientListenerPort = set;
    }

    private int nuggetServerListenerPort = 3010;

    /**
     * @return the nuggetServerListenerPort
     */
    public int getNuggetServerListenerPort() {
        return nuggetServerListenerPort;
    }

    /**
     * @param nuggetServerListenerPort the nuggetServerListenerPort to set
     */
    public void setNuggetServerListenerPort(int nuggetServerListenerPort) {
        this.nuggetServerListenerPort = nuggetServerListenerPort;
    }

    private int heartBeatWaitPeriod = 60000;

    public int getHeartBeatWaitPeriod(){
        return this.heartBeatWaitPeriod;
    }

    public void setHearBeatWaitPeriod(int set){
        this.heartBeatWaitPeriod = set;
    }


    private String metaServerLogLocation = "/logs/MetaNuggetLog.txt";

    public String getMetaServerLogLocation(){
        return this.metaServerLogLocation;
    }

    public void setMetaServerLogLocation(String set){
        this.metaServerLogLocation = set;
    }

    private int replicationPort = 4500;

    public int getReplicationPort(){
        return this.replicationPort;
    }

    public void setReplicationPort(int set){
        this.replicationPort = set;
    }

}
